package cn.wolfcode.wolf2w.spot.api;

import cn.wolfcode.wolf2w.common.core.constant.SecurityConstants;
import cn.wolfcode.wolf2w.common.core.domain.R;
import cn.wolfcode.wolf2w.spot.api.domain.Spot;
import cn.wolfcode.wolf2w.spot.api.factory.RemoteSpotFallbackFactory;
import cn.wolfcode.wolf2w.common.core.constant.ServiceNameConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
* 景点列表 远程服务
 *
 * @author dalang
 * @date 2023-11-23
 */
@FeignClient(contextId = "RemoteSpotService", name = ServiceNameConstants.SPOT_SERVICE, fallbackFactory = RemoteSpotFallbackFactory.class)
public interface RemoteSpotService {

    @GetMapping("/spots/feign/list")
    R<List<Spot>> list(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/spots/feign/{id}")
    R<Spot> getOne(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


}
